const useUpload = (url) => {
	uni.showLoading({
		title: '上传中.....'
	});
	return new Promise((resolve, reject) => {
		uni.uploadFile({
			// url: 'https://weixin.shuzinongyue.com:8942/userInfo/pic/upload',
			// url: 'http://61.163.243.13:8944/userInfo/pic/upload',
			// url: 'https://wechat.shuzinongyue.com:8922/userInfo/pic/upload',
			url: 'https://wechat.shuzinongyue.com:8922/api/MjUploadFiles/picture',
			filePath: url,
			name: 'file',
			success: res => {
				uni.hideLoading()
				resolve(JSON.parse(res.data).data)
			},
			fail: (e) => {
				console.log(e)
				uni.hideLoading();
			}
		});
	});
}

export default useUpload